import React from "react";
import {Dimensions, StyleSheet, Text, TouchableOpacity} from "react-native";
import PropTypes from "prop-types";
import {TextPropTypes} from 'deprecated-react-native-prop-types';

const WIN_WIDTH = Dimensions.get("window").width;

//闪屏页
class BorderText extends React.Component {

  static propTypes = {
    ...TextPropTypes,
    textStyle: PropTypes.object,
    padding: PropTypes.number,
    text: PropTypes.string,
    onPress: PropTypes.func,
  };

  static defaultProps = {
    ...Text.defaultProps,
    padding: 2
  };

  constructor() {
    super();
    this.state = {};
  }

  render() {
    let {style} = this.props;
    let props = {...this.props, style: this.props.textStyle}
    return (<TouchableOpacity
      style={{...style, padding: this.props.padding}}
      onPress={this.props.onPress}
    >
      <Text {...props} >{this.props.text}</Text>
    </TouchableOpacity>)
      ;
  }
}

const styles = StyleSheet.create({});
export default BorderText;